from research.calcor.calcors_graph import graph_calcor
import os
from jili.core import load,save
if __name__ == '__main__':
    from jili.core import load, save
    from research.calcor.calcors_graph import graph_calcor
    k1m = load(r"D:\data\future_k1m_tq\TA005\TA005_20200102.pkl")
    cc = [
        {'calc_cmd': 'ta', 'cmd': 'ATR', 'out': ['real'], 'input': {'prices': ['high', 'low', 'close']}, 'arg': {'timeperiod': 14}, 'batch': 14}
          ]
    c = graph_calcor(cc)
    k1ms = k1m[:29]
    for t in k1ms:
        t = c.onbar(t)
    print(t)
    t1 = k1m[30]
    t1["timekey"] = t["timekey"]
    t1 = c.onbar(t1)
    print(t1)
    print("end")